version: '3.4'
services:
  mysql_database:
    image: mysql:8.0.22
    container_name: mysql_database
    restart: always
    environment:
      - MYSQL_DATABASE=db
      - MYSQL_USER=${MYSQL_USER:?err}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD:?err}
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:?err}
    volumes:
      - mysql_database_data:/var/lib/mysql
    ports:
      - 3306:3306
    networks:
      - local

volumes:
  mysql_database_data:

networks:
  local:
    driver: bridge
